﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using GalaSoft.MvvmLight;
using PPP.Model;

namespace PPP.ViewModel {
    /// <summary>
    /// Main ViewModel. 
    /// 
    /// <list type="bullet">
    /// <item>
    /// <term>Author</term>
    /// <description>Sebastian Will</description>
    /// </item>
    /// </list>
    /// 
    /// </summary>  
    public class PicturePropertiesViewModel : ViewModelBase {             

        #region Fields

        /// <summary>
        /// The picture.
        /// </summary>
        private Picture _picture;
        
        #endregion

        #region Consts
        #region PropertyName Consts

        /// <summary>
        /// The <see cref="SmaleFileIndicatorVisibility" /> property's name.
        /// </summary>
        public const string SmaleFileIndicatorVisibilityPropertyName = "SmaleFileIndicatorVisibility";

        #endregion
        #endregion

        #region Properties

        /// <summary>
        /// Gets the PictureProperties property.        
        /// </summary>
        public Picture Picture {
            get {
                return _picture;
            }
            set { _picture = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public Visibility SmaleFileIndicatorVisibility {
            get {
                return Picture.FileSize == long.MinValue
                    ? Visibility.Visible : Visibility.Collapsed;
            }
        }

        #region Commands
        #endregion
        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the PicturePropertiesViewModel class.
        /// </summary>
        /// <param name="picturePropertiesModel">A picture propertie model</param>
        public PicturePropertiesViewModel(Picture picturePropertiesModel) {
            _picture = picturePropertiesModel;
            Picture.PropertyChanged += (s, e) => {
                if (e.PropertyName == Picture.FileNamePropertyName)
                    RaisePropertyChanged(SmaleFileIndicatorVisibilityPropertyName);
            };
        }

        #endregion

        #region Methods
        #endregion

        #region Events
        #endregion

    }
}
